<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML>
<html>
<head>
<base href="<%=basePath%>">

<title>新增雨量检测信息</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
<script type="text/javascript" src="js/jquery-3.4.0.js"></script>
</head>

<body>
	<div class="body">
		<h1>新增雨量检测信息</h1>
		<form action="RS?type=add" method="post">
			<table>
				<tr>
					<td>区域名称：</td>
					<td><input type="text" name="name" required></td>
				</tr>
				<tr>
					<td>检测时间：</td>
					<td><input type="text" name="time" required pattern="\d{4}\.\d{1,2}\.\d{1,2}">yyyy.MM.dd格式</td>
				</tr>
				<tr>
					<td>雨量值（mm）：</td>
					<td><input type="text" name="rain" required></td>
				</tr>
				<tr>
					<td>检测站：</td>
					<td><input type="text" name="station" required></td>
				</tr>
				<tr>
					<td>站点地址：</td>
					<td><input type="text" name="address" required></td>
				</tr>
				<tr>
					<td colspan="2"><input type="submit" value="保存"> <input
						type="reset" value="重置"> <input type="button" value="返回"
						class="back"></td>
				</tr>
			</table>
		</form>
	</div>
	<script type="text/javascript">
		$(function(){
			$(".back").click(function(){
				location.href = "index.jsp";
			});
			$("form").submit(function(){
				var rain = $("[name=rain]").val();
				if(isNaN(rain)){
					alert("雨量值有误！");
					return false;
				}
			});
		});
	</script>
	
</body>
</html>
